
var serviceIp;

$(function(){
	$.ajaxSettings.async = false;
	$.getJSON("../data/da.json", function (data) {
		//data就是json对象了，不需要再转换
		//serviceIp = data.serviceIp;
		serviceIp = getRootUrl() + "/";
		console.log(serviceIp);
	});
})

function getRootUrl() {
	var path = window.location.pathname.substring(1);
	var root = (path == '') ? '' : path.substring(0, path.indexOf('/'));
	return window.location.protocol + '//' + window.location.host + '/' + root;
}